#include <bits/stdc++.h>

#define eb emplace_back
#define ep emplace
#define fi first
#define se second
#define in read<int>()
#define lin read<ll>()
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using ll = long long;
using db = double;
using pii = pair < int, int >;
using vec = vector < int >;
using veg = vector < pii >;

template < typename T > T read() {
	T x = 0; bool f = 0; char ch = getchar();
	while(!isdigit(ch)) f |= ch == '-', ch = getchar();
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = getchar();
	return f ? -x : x;
}

template < typename T > void chkmax(T &x, const T &y) { x = x > y ? x : y; }
template < typename T > void chkmin(T &x, const T &y) { x = x < y ? x : y; }

const int N = 1e5 + 10;
const int mod = 998244353;

char s[N];
vec pot;
int n, fac[N], ifac[N], f[N], ans;

ll C(int x, int y) { return x < 0 || y < 0 || x < y ? 0 : 1ll * fac[x] * ifac[y] % mod * ifac[x - y] % mod; }
ll qp(ll x, int t) { ll res = 1; for(; t; t >>= 1, x = x * x % mod) if(t & 1) res = res * x % mod; return res; }

int main() {
#ifndef ONLINE_JUDGE
	freopen("1.in", "r", stdin);
#endif
	n = in; scanf("%s", s + 1);
	pot.eb(0); rep(i, 1, n) if(s[i] == '.') pot.eb(i);
	f[0] = 1; rep(i, 1, n) f[i] = 1ll * f[i - 1] * (2 * i - 1) % mod;
	fac[0] = 1; rep(i, 1, n) fac[i] = 1ll * fac[i - 1] * i % mod;
	ifac[n] = qp(fac[n], mod - 2); per(i, n - 1, 0) ifac[i] = 1ll * ifac[i + 1] * (i + 1) % mod;
	int k = pot.size() - 1; pot.eb(n + 1); int ans = 0;
	rep(i, 0, k) {
		int cnt = pot[i];
		rep(j, pot[i] + 1, pot[i + 1] - 1) if(s[j] == '<') cnt++;
		ans = (ans + C(k, i) * cnt % mod * f[i] % mod * f[k - i] % mod) % mod;
	} rep(i, 1, k) ans = 1ll * ans * qp(i * 2, mod - 2) % mod; printf("%d\n", ans);
	return 0;
}
